<?php if (Yii::app()->user->hasFlash('success')): ?>
    <div class="alert alert_grey">
        <img height="24" width="24" src="<?php echo Yii::app()->params['backendUrl']; ?>/images/icons/small/grey/success.png">
        <?php echo Yii::app()->user->getFlash('success'); ?>
    </div>
<?php endif; ?>
<?php if (Yii::app()->user->hasFlash('error')): ?>
    <div class="alert alert_grey">
        <img height="24" width="24" src="<?php echo Yii::app()->params['backendUrl']; ?>/images/icons/small/grey/alert_2.png">
        <?php echo Yii::app()->user->getFlash('error'); ?>
    </div>
<?php endif; ?>
<?php
//echo CHtml::form("http://globalinfinite.com/system/admin/system/withdraw/excel", 'post'); //IKI PERBUATANE SOPO???
echo CHtml::form($this->createUrl('excel'), 'post');
?>
<div class="flat_area grid_16">
    <h2>List of Withdraw</h2>
    <button class="button_colour round_all" name="update"><img height="24" width="24" alt="Bended Arrow Right" src="<?php echo Yii::app()->params['backendUrl']; ?>/images/icons/small/white/bended_arrow_right.png"><span>UPDATE</span></button>
</div>
<?php
$this->widget('zii.widgets.grid.CGridView', array(
    'dataProvider'=>$data_withdraw,
    'columns' => array(
        array('header' => '#',
              'type' => 'raw',
              'value' => 'CHtml::checkBox("withdraw[]", false, array("value" => $data->ewallet_withdrawal_id));',
              'htmlOptions' => array('style' => 'text-align:center;')),
        array('header' => 'No.',
              'value' => '$this->grid->dataProvider->pagination->currentPage * $this->grid->dataProvider->pagination->pageSize + ($row+1)."."',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array('header' => 'Member MID',
              'value' => 'function_lib::get_network_mid($data->ewallet_withdrawal_network_id);',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
       array('header' => 'Member Bank Account Name',
              'value' => 'function_lib::get_one("member_bank_account_name","sys_member","member_network_id = $data->ewallet_withdrawal_network_id")',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array('header' => 'Bank Name',
              'value' => 'function_lib::get_bank_name(function_lib::get_one("member_bank_id", "sys_member", "member_network_id = \'$data->ewallet_withdrawal_network_id\'"))',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array('header' => 'Bank Account No',
              'value' => 'function_lib::get_one("member_bank_account_no", "sys_member", "member_network_id = \'$data->ewallet_withdrawal_network_id\'")',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
         array('header' => 'Branch',
              'value' => 'function_lib::get_one("member_bank_branch","sys_member","member_network_id = $data->ewallet_withdrawal_network_id")',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array('header' => 'Withdrawal Value',
              'value' => 'number_format($data->ewallet_withdrawal_value);',
              'htmlOptions' => array('style' => 'text-align:center;'),
            ),
        array('header' => 'Withdrawal Date',
              'value' => 'function_lib::convert_datetime($data->ewallet_withdrawal_datetime, " ")',
               'htmlOptions' => array('style' => 'text-align:center;'))
        ),
    'pager' => array(
        'cssFile' => Yii::app()->params['backendUrl'] . '/css/style-pager.css',
        'header' => '',
        'firstPageLabel' => 'First',
        'prevPageLabel' => 'Previous',
        'nextPageLabel' => 'Next',
        'lastPageLabel' => 'Last',
    ),
    'selectableRows' => 2,
    'selectionChanged' => 'userClicks',
    'cssFile' => Yii::app()->params['backendUrl'] . '/css/style-gridview.css',
));
echo CHtml::endForm();
?>